package com.imonsoft.common.base.aop;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.aspectj.lang.JoinPoint;

import com.imonsoft.common.exception.SystemException;

/**
 * Service 层的切面处理，目前主要是异常的处理
 * 
 * @author LiQianHui
 * @date 2013-5-17
 * @version 2013
 */
public class AopAspectService {

	protected final Log logger = LogFactory.getLog(getClass());

	public void doThrowing(JoinPoint jp, Throwable ex) {

		if (ex instanceof SystemException) {
			logger.info(jp.getSignature().getName() + ": " + ex.getMessage());
		} else {
			logger.error(jp.getSignature().getName() + "异常内容: " + ex.getMessage());
		}
	}
}
